package character.ai;

import character.MyCharacter;

public class CharacterThreat {
    protected MyCharacter character;
    protected int threat;
    
    @Deprecated
    protected CharacterThreat() {}
    
    public CharacterThreat(MyCharacter character) {
        this.character = character;
    }
    
    public CharacterThreat(MyCharacter character, int threat) {
        this(character);
        this.threat = threat;
    }

    public MyCharacter getCharacter() {
        return character;
    }
    public int getThreat() {
        return threat;
    }
    public void addThreat(int amount) {
        threat += amount;
    }

    @Override
    public boolean equals(Object obj) {
        if (obj == null) {
            return false;
        }
        if (getClass() != obj.getClass()) {
            return false;
        }
        final CharacterThreat other = (CharacterThreat) obj;
        if (this.character != other.character && (this.character == null || !this.character.equals(other.character))) {
            return false;
        }
        return true;
    }

    @Override
    public int hashCode() {
        int hash = 7;
        hash = 41 * hash + (this.character != null ? this.character.hashCode() : 0);
        return hash;
    }
}
